<template>
  <div>
    <!-- 第一种做法 不推荐 有缺陷 引发watch的冻结  麻烦 -->
  <!-- <FilmList :list="filmlist" :type="type" :key="'a' + filmlist.length">
    </FilmList>  -->
    <!-- 这种做法的话不会引发 watch冻结  一切正常 推荐  -->
      <FilmList :list="this.$store.state.storenowplayinglist" :type="type" >
    </FilmList>  
  </div>
</template>

<script>
import FilmList from "@/components/FilmList";
import { nowPlayingListData } from "@/api/api";
//nowPlayingListData = (page =1)=>{
//     return http.get(nowPlayingListUri+page)
// }

export default {
  props: [],
  components: {
    FilmList,
  },
  data() {
    return {
      type: 1,
      filmlist: "",
    };
  },

  methods: {},

  computed: {},

  watch: {},

  filters: {},

  beforeCreate() {},

  created() {
    // export const nowPlayingListData = (page =1)=>{
    //     return http.get(nowPlayingListUri+page)
    // }
    // setTimeout(() => {
    //   console.log("进入nowplayingcreated里面了");
    //   nowPlayingListData().then((res) => {
    //     console.log("res", res);
    //     this.filmlist = res.data.data.films;
    //   });
    // }, 0);


    this.$store.dispatch('atimenowplayingdata',1)
  },

  beforeMount() {},

  mounted() {},

  beforeUpdate() {},

  updated() {},

  beforeDestroy() {},

  destroyed() {},
};
</script>


<style  lang='scss'>
</style>
